Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

think-helper

Package Overview
Dependencies
Maintainers
5
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

think-helper

Helper for ThinkJS

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
838
increased by14.95%
Maintainers
5
Weekly downloads
 
Created
Source

think-helper

Build Status Coverage Status npm

think-helper defines a set of helper functions for ThinkJS.

Installation

Using npm:

npm install think-helper

In Node.js:

import helper from 'think-helper';

let md5 = helper.md5('');

APIs:

APIParamDescription
isIntcheck integer
isIPcheck IP
isIPv4check IPv4
isIPv6check IPv6
isMastercluster.isMaster
isArrayarg{mix}
return{Boolean}
check if a variable is an Array
isBooleanarg{mix}
return{Boolean}
check if a variable is an Boolean
isNullarg{mix}
return{Boolean}
check if a variable is an null
isNullOrUndefinedarg{mix}
return{Boolean}
check if a variable is null or undefined
isNumberarg{mix}
return{Boolean}
check if a variable is an Number
isStringarg{mix}
return{Boolean}
check if a variable is an String
isSymbolarg{mix}
return{Boolean}
check if a variable is an Symbol
isUndefinedarg{mix}
return{Boolean}
check if a variable is an undefined
isRegExparg{mix}
return{Boolean}
check if a variable is an RegExp
isObjectarg{mix}
return{Boolean}
check if a variable is an Object
isDatearg{mix}
return{Boolean}
check if a variable is an Date
isErrorarg{mix}
return{Boolean}
check if a variable is an Error
isFunctionarg{mix}
return{Boolean}
check if a variable is an Function
isPrimitivearg{mix}
return{Boolean}
check if a variable is an Primitive
isBufferarg{mix}
return{Boolean}
check if a variable is an Buffer
promisifyfunction{function}
receiver{object}
return Promise
make callback function to promise
extendtarget{object|array}
args{Object|Array}
return{Object}
extend object
camelCasestr{string}
return{String}
make indexAction to index_action
isNumberStringstr{string}
return{Boolean}
check object is number string
isTrueEmptyobj{mixed}
return{Boolean}
truely
isEmptyobj{object}
return{Boolean}
check object is mepty
deferreturn deferget deferred object
md5str{string}
return{string}
get content md5
timeouttime{Number}
return Promise
get timeout Promise
escapeHtmlstr{String}
return {string}
escape html
datetimedate{Date|String}
format{String}
return{String}
get datetime
uuidversion{String} v1 or v4generate uuid
isExistdir{String}check path is exist
isFilefilePath{String}check filepath is file
isDirectoryfilePath{String}check path is directory
chmodpath{String}
mode{String}
change path mode
mkdirdir{String}
mode{String}
make dir
getdirFilesdir{String}
prefix{String}
get files in path
rmdirpath{String}
reserve{Boolean}
return{Promise}
remove dir async
parseAdapterConfigconfig{Object}
extConfig{Object|String}
parse adapter config
mstime{String}transform humanize time to ms
omitobj{obj}
prop {String
Array}

FAQs

Package last updated on 27 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc